wx.request({
      url: 'https://test.qcms.online/api/v1/pay/pre_order',
      method: 'post',
      data: { 
        id: that.data.one.id
      },
      header: {
        'content-type': 'application/json',
        'token': wx.getStorageSync('token')
      },
      success: function (data) {
        console.log('success11111111111');
        console.log(data);
        tt.pay({
          orderInfo: data.data,
          service: 1,
          _debug:1,
          getOrderStatus(res) {
            console.log('getOrderStatus');
            console.log(res);
            console.log(res.out_order_no);
            that.setData({
              order_no:res.out_order_no
            })
            return new Promise(function(resolve, reject) {
              wx.request({
                url: 'https://test.qcms.online/api/v1/pay/check',
                method: 'post',
                data: { 
                  tradeno: res.out_order_no
                },
                header: {
                  'content-type': 'application/json',
                  'token': wx.getStorageSync('token')
                },
                success: function (rs) {
                  console.log("ffffffffffff");console.log(rs);console.log("eeeeeeeeeeeeeeeeeeeee");
                  if(rs.data.status == 0){
                    //支付成功,执行关闭支付窗口
                    //let { out_order_no } = rs;
                   resolve({ code: 0});//订单id
                  }else if(rs.data.status == 4){
                   resolve({ code: 4});
                  }else if(rs.data.status == 3){
                   resolve({ code: 3});
                  }else{
                    resolve({ code: 2});
                    //0：支付成功 1：支付超时 2：支付失败 3：支付关闭 4：支付取消 
                    //9：订单状态开发者自行获取。
                    //只要调起收银台成功，支付状态都会回调success返回，开发者依据返回的 code 值，进行后续业务逻辑处理
                  }
                }
              });
            });
          },
          success(res) {
            console.log('success');console.log(res);
            if (res.code == 0) {
              var order_no = that.data.order_no;
              console.log('id');console.log(res);console.log(res.id);console.log('detail id');
              wx.navigateTo({
                url: '../exam/exam?order_no='+order_no
              })
            }else if (res.code == 3) {
            }else{
            }
          },
          fail(res) {
            console.log('fail2');console.log(res);
            tt.showToast({
              title: res.errMsg, // 内容
              success: (res) => {
              }
            });
           }
        });
      },
      fail: function (err) {
        console.log('fail1');console.log(err);
      }
    });
